/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.jfonia.actions;

import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import org.jfonia.images.ImageConstants;
import org.jfonia.images.ScaledImageIcon;
import org.jfonia.language.DescriptionConstants;
import org.jfonia.language.LabelConstants;
import org.jfonia.language.LanguageResource;
import org.jfonia.model.Sequence;
import org.jfonia.model.Staff;
import org.jfonia.model.elements.Chord;
import org.jfonia.view.main.Project;

/**
 *
 * @author Rik Bauwens
 */
public class CreateChordPartAction extends AbstractAction
{
        protected CreateChordPartAction(int iconMaxSize)
        {
                super(LanguageResource.getInstance().getLabel(LabelConstants.CHORD_PART),
                      new ScaledImageIcon(ImageConstants.CHORD_PART,
                      LanguageResource.getInstance().getDescription(DescriptionConstants.CHORD_PART))
                      .setMaximumSide(iconMaxSize).getImageIcon());
        }

        public void actionPerformed(ActionEvent e)
        {
                Staff chordStaff = new Staff();
                Sequence<Chord> chordSequence = new Sequence<Chord>(Chord.class);
                chordStaff.addSequence(chordSequence);
                chordSequence.add(new Chord(1).setChord("chord"));
                Project.getInstance().getCurrentLeadSheet().getStaffCollection().addStaff(chordStaff);
        }
}